﻿@model List<DLULearningNetworkModel.CourseNotification>
@using DLULearningNetwork.Libs;
@using DLULearningNetworkModel;
@{
    Account currentUser = DLULearningNetwork.ActionFilterAttributes.RequireUserLogin.LoginUser;
}
@if (Model != null && Model.Count != 0)
{
    <ul>
        @foreach (CourseNotification cn in Model)
        {
        
            <li NotificationID="@cn.CourseNotificationID_u" typeNotification="course">
                <div class="record" style="clear: both; border-bottom: 1px solid green; padding: 5px 0 5px 5px;">
                    @{ 
            EnumFeedType feedType = (EnumFeedType)Enum.Parse(typeof(EnumFeedType), cn.FeedReference.Value.Type_s);
                    }
                    @switch (feedType)
                    {
                        case EnumFeedType.ActivityPostOnCourseWall:
                        <div style="float: left; padding-right: 3px; width: 40px;">
                            <a href="/UserPage/UserHome/@cn.FeedReference.Value.AccountReference.Value.Nickname_s" onclick="HasReadNotification('@cn.CourseNotificationID_u','course')">
                                <img src="@DLULearningNetwork.Libs.StringHelper.GetImageUrl(cn.FeedReference.Value.AccountReference.Value.Avatar_s, 1)" style="width: 40px; height: 40px; float: left; padding-right: 3px;" />
                            </a>
                        </div>
                        <div style=" vertical-align: top; position: relative; display: block;">
                            <a href="#" name="checkNotification" style ="display:none;margin:0;padding:0;float:right;" >
                                <img src="../../Content/Images/check.png" title="Xóa" />
                            </a><span style="display: block;">
                                @StringHelper.GetHtmlAccountName(cn.FeedReference.Value.AccountReference.Value)</span>
                                vừa đăng <a href="/Feed/Detail/@StringHelper.GetGuidFromContent(cn.FeedReference.Value.Content_s)">bài viết</a> 
                                lên tường lớp @StringHelper.GetHtmlCourseName(cn.FeedReference.Value.CourseReference.Value)
                            <span>"@MvcHtmlString.Create(StringHelper.GetContentFromContent(cn.FeedReference.Value.Content_s).Replace("\\n", "<br>"))"</span>
                        </div>
                        <div style="clear: both;">
                        </div>
                              break;
                        case EnumFeedType.ActivityComment:
                        <div style="float: left; padding-right: 3px; width: 40px;">
                            <a href="/UserPage/UserHome/@cn.FeedReference.Value.AccountReference.Value.Nickname_s" onclick="HasReadNotification('@cn.CourseNotificationID_u','course')">
                                <img src="@DLULearningNetwork.Libs.StringHelper.GetImageUrl(cn.FeedReference.Value.AccountReference.Value.Avatar_s, 1)" style="width: 40px; height: 40px; float: left; padding-right: 3px;" />
                            </a>
                        </div>
                        <div style=" vertical-align: top; position: relative; display: block;">
                            <a href="#" name="checkNotification" style ="display:none;margin:0;padding:0;float:right;" >
                                <img src="../../Content/Images/check.png" title="Xóa" />
                            </a><span style="display: block;">
                                @StringHelper.GetHtmlAccountName(cn.FeedReference.Value.AccountReference.Value)</span>
                                vừa bình luận <a href="/Feed/Detail/@cn.FeedReference.Value.FeedCommentReference.Value.FeedReference.Value.FeedID_u">
                                    bài viết</a> của @StringHelper.GetHtmlAccountName(cn.FeedReference.Value.FeedCommentReference.Value.FeedReference.Value.AccountReference.Value)
                            lên tường @StringHelper.GetHtmlCourseName(cn.FeedReference.Value.FeedCommentReference.Value.FeedReference.Value.CourseReference.Value)
                            <span>"@MvcHtmlString.Create(StringHelper.GetContentFromContent(cn.FeedReference.Value.Content_s).Replace("\\n", "<br>"))"</span>
                        </div>
                        <div style="clear: both;">
                        </div>
                              break;
                        case EnumFeedType.ActivityChangeSeminarSchedule:
                        <div style="float: left; padding-right: 3px; width: 40px;">
                            <a href="/UserPage/UserHome/@cn.FeedReference.Value.AccountReference.Value.Nickname_s" onclick="HasReadNotification('@cn.CourseNotificationID_u','course')">
                                <img src="@DLULearningNetwork.Libs.StringHelper.GetImageUrl(cn.FeedReference.Value.AccountReference.Value.Avatar_s, 1)" style="width: 40px; height: 40px; float: left; padding-right: 3px;" />
                            </a>
                        </div>
                        <div style=" vertical-align: top; position: relative; display: block;">
                            <a href="#" name="checkNotification" style ="display:none;margin:0;padding:0;float:right;" >
                                <img src="../../Content/Images/check.png" title="Xóa" />
                            </a><span style="display: block;">
                                @StringHelper.GetHtmlAccountName(cn.FeedReference.Value.AccountReference.Value) :</span>
                                 <span>"@MvcHtmlString.Create(StringHelper.GetContentFromContent(cn.FeedReference.Value.Content_s).Replace("\\n", "<br>"))"</span>
                            của lớp @StringHelper.GetHtmlCourseName(cn.FeedReference.Value.CourseReference.Value)
                        </div>
                        <div style="clear: both;">
                        </div>
                           
                               break;
                        case EnumFeedType.ActivityChangeResourse:
                        <div style="float: left; padding-right: 3px; width: 40px;">
                            <a href="/UserPage/UserHome/@cn.FeedReference.Value.AccountReference.Value.Nickname_s" onclick="HasReadNotification('@cn.CourseNotificationID_u','course')">
                                <img src="@DLULearningNetwork.Libs.StringHelper.GetImageUrl(cn.FeedReference.Value.AccountReference.Value.Avatar_s, 1)" style="width: 40px; height: 40px; float: left; padding-right: 3px;" />
                            </a>
                        </div>
                        <div style=" vertical-align: top; position: relative; display: block;">
                            <a href="#" name="checkNotification" style ="display:none;margin:0;padding:0;float:right;" >
                                <img src="../../Content/Images/check.png" title="Xóa" />
                            </a><span style="display: block;">
                                @StringHelper.GetHtmlAccountName(cn.FeedReference.Value.AccountReference.Value):</span>
                                 <span>"@MvcHtmlString.Create(StringHelper.GetContentFromContent(cn.FeedReference.Value.Content_s).Replace("\\n", "<br>"))"</span>
                            của lớp @StringHelper.GetHtmlCourseName(cn.FeedReference.Value.CourseReference.Value)
                        </div>
                        <div style="clear: both;">
                        </div>
                               break;
                    }
                </div>
            </li>
        }
    </ul>
}
else
{ 
    <p name="noMore">
        Chưa có thông báo mới</p>
}